package com.jucai.pppeiyouclient.adapter;

import android.content.Context;

import com.jucai.pppeiyouclient.R;
import com.jucai.pppeiyouclient.base.CommonRecyclerViewAdapter;
import com.jucai.pppeiyouclient.bean.AccompanyNewsBean;

import java.util.List;

/**
 * Created by Kuky on 2017-05-02.
 */

public class AccompanyNewAdapter extends CommonRecyclerViewAdapter<AccompanyNewsBean> {

    public AccompanyNewAdapter(Context context, List<AccompanyNewsBean> data) {
        super(context, data);
    }

    @Override
    public void bindHolder(CommonHolder holder, AccompanyNewsBean accompanyNewsBean) {
        holder.setImage(R.id.news_user_img, accompanyNewsBean.getAccompanyAvatar(), 60, 60);
        holder.setText(R.id.news_user_name, accompanyNewsBean.getAccompanyName());
        holder.setText(R.id.user_news_count, "消息数：" + accompanyNewsBean.getNewsCount());
        holder.setText(R.id.news_send_time, "发送时间：" + accompanyNewsBean.getSendTime());
        if (accompanyNewsBean.getStatus() == 0) {
            holder.setText(R.id.news_status, "未读");
        } else if (accompanyNewsBean.getStatus() == 1) {
            holder.setText(R.id.news_status, "已读");
        }
    }

    @Override
    protected int getItemType(int position) {
        return 0;
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_accompany_news;
    }
}
